function [price]=adjPrice(price,varargin)

nCol=size(price,2);
for i=1:nCol
    if isempty(varargin)    %     k=find(price(:,i)==0);
        k=sort([find(price(:,i)==0);find(isnan(price(:,i)))]);
    else
        k=find(isnan(price(:,i)));
    end
    if k~=0
        if price(1,i) == 0
            price(1,i) = price(1,end);
        end
        for j=2:length(k)
            price(k(j),i)=price(k(j)-1,end);
        end
        
    end
end
